package com.apigen.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * API端点实体类
 *
 * @author API Generator Platform
 * @since 2025-09-24
 */
@Data
@TableName("gen_api_endpoint")
@Schema(description = "API端点信息")
public class GenApiEndpoint {

    /**
     * 端点ID
     */
    @TableId(value = "endpoint_id", type = IdType.AUTO)
    @Schema(description = "端点ID", example = "1")
    private Long endpointId;

    /**
     * 端点名称
     */
    @TableField("endpoint_name")
    @Schema(description = "端点名称", example = "获取用户列表")
    private String endpointName;

    /**
     * 端点路径
     */
    @TableField("endpoint_path")
    @Schema(description = "端点路径", example = "/api/users")
    private String endpointPath;

    /**
     * HTTP方法
     */
    @TableField("http_method")
    @Schema(description = "HTTP方法", example = "GET")
    private String httpMethod;

    /**
     * 关联表ID
     */
    @TableField("table_id")
    @Schema(description = "关联表ID", example = "1")
    private Long tableId;

    /**
     * 端点描述
     */
    @TableField("description")
    @Schema(description = "端点描述", example = "分页获取用户列表")
    private String description;

    /**
     * 启用分页
     */
    @TableField("enable_pagination")
    @Schema(description = "启用分页", example = "true")
    private Boolean enablePagination;

    /**
     * 启用排序
     */
    @TableField("enable_sorting")
    @Schema(description = "启用排序", example = "true")
    private Boolean enableSorting;

    /**
     * 启用筛选
     */
    @TableField("enable_filtering")
    @Schema(description = "启用筛选", example = "true")
    private Boolean enableFiltering;

    /**
     * 响应格式
     */
    @TableField("response_format")
    @Schema(description = "响应格式", example = "JSON")
    private String responseFormat;

    /**
     * 所属项目ID
     */
    @TableField("project_id")
    @Schema(description = "所属项目ID", example = "1")
    private Long projectId;

    /**
     * 创建者ID
     */
    @TableField("creator_id")
    @Schema(description = "创建者ID", example = "1000")
    private Long creatorId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 是否删除
     */
    @TableField("deleted")
    @TableLogic
    @Schema(description = "是否删除", example = "false")
    private Boolean deleted;
}










